function Merchant(params){ 
	 
}

Merchant.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new Merchant.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new Merchant.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new Merchant.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 品牌名称 [非空]       **/
	this.brandName=function(brandName){if(this.proxy)return this.getProxy().brandName(brandName);  this.put("brandName", brandName);return this;};
	/** and brand_name is null */
	this.brandNameNull=function(){if(this.proxy)return this.getProxy().brandNameNull();if(this.get("brandNameNot")==null)this.put("brandNameNot", "");this.put("brandName", null);return this;};
	/** not .... */
	this.brandNameNot=function(){if(this.proxy)return this.getProxy().brandNameNot();this.put("brandNameNot", "not");return this;};
	this.brandNameNotNull=function(){if(this.proxy)return this.getProxy().brandNameNotNull();this.put("brandNameNot", "not");this.put("brandName", null);return this;};
	this.brandNameNot=function(brandName){if(this.proxy)return this.getProxy().brandNameNot(brandName);this.put("brandNameNot", "not");this.put("brandName", brandName);return this;};
	
	/** 品牌主图 [非空]       **/
	this.banner=function(banner){if(this.proxy)return this.getProxy().banner(banner);  this.put("banner", banner);return this;};
	/** and banner is null */
	this.bannerNull=function(){if(this.proxy)return this.getProxy().bannerNull();if(this.get("bannerNot")==null)this.put("bannerNot", "");this.put("banner", null);return this;};
	/** not .... */
	this.bannerNot=function(){if(this.proxy)return this.getProxy().bannerNot();this.put("bannerNot", "not");return this;};
	this.bannerNotNull=function(){if(this.proxy)return this.getProxy().bannerNotNull();this.put("bannerNot", "not");this.put("banner", null);return this;};
	this.bannerNot=function(banner){if(this.proxy)return this.getProxy().bannerNot(banner);this.put("bannerNot", "not");this.put("banner", banner);return this;};
	
	/** 品牌简介        **/
	this.profile=function(profile){if(this.proxy)return this.getProxy().profile(profile);  this.put("profile", profile);return this;};
	/** and profile is null */
	this.profileNull=function(){if(this.proxy)return this.getProxy().profileNull();if(this.get("profileNot")==null)this.put("profileNot", "");this.put("profile", null);return this;};
	/** not .... */
	this.profileNot=function(){if(this.proxy)return this.getProxy().profileNot();this.put("profileNot", "not");return this;};
	this.profileNotNull=function(){if(this.proxy)return this.getProxy().profileNotNull();this.put("profileNot", "not");this.put("profile", null);return this;};
	this.profileNot=function(profile){if(this.proxy)return this.getProxy().profileNot(profile);this.put("profileNot", "not");this.put("profile", profile);return this;};
	
	/** 公司名称 [非空]       **/
	this.corporateName=function(corporateName){if(this.proxy)return this.getProxy().corporateName(corporateName);  this.put("corporateName", corporateName);return this;};
	/** and corporate_name is null */
	this.corporateNameNull=function(){if(this.proxy)return this.getProxy().corporateNameNull();if(this.get("corporateNameNot")==null)this.put("corporateNameNot", "");this.put("corporateName", null);return this;};
	/** not .... */
	this.corporateNameNot=function(){if(this.proxy)return this.getProxy().corporateNameNot();this.put("corporateNameNot", "not");return this;};
	this.corporateNameNotNull=function(){if(this.proxy)return this.getProxy().corporateNameNotNull();this.put("corporateNameNot", "not");this.put("corporateName", null);return this;};
	this.corporateNameNot=function(corporateName){if(this.proxy)return this.getProxy().corporateNameNot(corporateName);this.put("corporateNameNot", "not");this.put("corporateName", corporateName);return this;};
	
	/** 公司地址 [非空]       **/
	this.companyAddress=function(companyAddress){if(this.proxy)return this.getProxy().companyAddress(companyAddress);  this.put("companyAddress", companyAddress);return this;};
	/** and company_address is null */
	this.companyAddressNull=function(){if(this.proxy)return this.getProxy().companyAddressNull();if(this.get("companyAddressNot")==null)this.put("companyAddressNot", "");this.put("companyAddress", null);return this;};
	/** not .... */
	this.companyAddressNot=function(){if(this.proxy)return this.getProxy().companyAddressNot();this.put("companyAddressNot", "not");return this;};
	this.companyAddressNotNull=function(){if(this.proxy)return this.getProxy().companyAddressNotNull();this.put("companyAddressNot", "not");this.put("companyAddress", null);return this;};
	this.companyAddressNot=function(companyAddress){if(this.proxy)return this.getProxy().companyAddressNot(companyAddress);this.put("companyAddressNot", "not");this.put("companyAddress", companyAddress);return this;};
	
	/** 联系人 [非空]       **/
	this.contacts=function(contacts){if(this.proxy)return this.getProxy().contacts(contacts);  this.put("contacts", contacts);return this;};
	/** and contacts is null */
	this.contactsNull=function(){if(this.proxy)return this.getProxy().contactsNull();if(this.get("contactsNot")==null)this.put("contactsNot", "");this.put("contacts", null);return this;};
	/** not .... */
	this.contactsNot=function(){if(this.proxy)return this.getProxy().contactsNot();this.put("contactsNot", "not");return this;};
	this.contactsNotNull=function(){if(this.proxy)return this.getProxy().contactsNotNull();this.put("contactsNot", "not");this.put("contacts", null);return this;};
	this.contactsNot=function(contacts){if(this.proxy)return this.getProxy().contactsNot(contacts);this.put("contactsNot", "not");this.put("contacts", contacts);return this;};
	
	/** 联系电话 [非空]       **/
	this.contactNumber=function(contactNumber){if(this.proxy)return this.getProxy().contactNumber(contactNumber);  this.put("contactNumber", contactNumber);return this;};
	/** and contact_number is null */
	this.contactNumberNull=function(){if(this.proxy)return this.getProxy().contactNumberNull();if(this.get("contactNumberNot")==null)this.put("contactNumberNot", "");this.put("contactNumber", null);return this;};
	/** not .... */
	this.contactNumberNot=function(){if(this.proxy)return this.getProxy().contactNumberNot();this.put("contactNumberNot", "not");return this;};
	this.contactNumberNotNull=function(){if(this.proxy)return this.getProxy().contactNumberNotNull();this.put("contactNumberNot", "not");this.put("contactNumber", null);return this;};
	this.contactNumberNot=function(contactNumber){if(this.proxy)return this.getProxy().contactNumberNot(contactNumber);this.put("contactNumberNot", "not");this.put("contactNumber", contactNumber);return this;};
	
	/** 备注信息        **/
	this.remark=function(remark){if(this.proxy)return this.getProxy().remark(remark);  this.put("remark", remark);return this;};
	/** and remark is null */
	this.remarkNull=function(){if(this.proxy)return this.getProxy().remarkNull();if(this.get("remarkNot")==null)this.put("remarkNot", "");this.put("remark", null);return this;};
	/** not .... */
	this.remarkNot=function(){if(this.proxy)return this.getProxy().remarkNot();this.put("remarkNot", "not");return this;};
	this.remarkNotNull=function(){if(this.proxy)return this.getProxy().remarkNotNull();this.put("remarkNot", "not");this.put("remark", null);return this;};
	this.remarkNot=function(remark){if(this.proxy)return this.getProxy().remarkNot(remark);this.put("remarkNot", "not");this.put("remark", remark);return this;};
	
	/** 排序     数值越大越排前   **/
	this.mSort=function(mSort){if(this.proxy)return this.getProxy().mSort(mSort);  this.put("mSort", mSort);return this;};
	/** and m_sort is null */
	this.mSortNull=function(){if(this.proxy)return this.getProxy().mSortNull();if(this.get("mSortNot")==null)this.put("mSortNot", "");this.put("mSort", null);return this;};
	/** not .... */
	this.mSortNot=function(){if(this.proxy)return this.getProxy().mSortNot();this.put("mSortNot", "not");return this;};
	this.mSortNotNull=function(){if(this.proxy)return this.getProxy().mSortNotNull();this.put("mSortNot", "not");this.put("mSort", null);return this;};
	this.mSortNot=function(mSort){if(this.proxy)return this.getProxy().mSortNot(mSort);this.put("mSortNot", "not");this.put("mSort", mSort);return this;};
	/** and m_sort <= ? */
	this.mSortMin=function(min){if(this.proxy)return this.getProxy().mSortMin(min);this.put("mSortMin", min);return this;};
	/** and m_sort >= ? */
	this.mSortMax=function(max){if(this.proxy)return this.getProxy().mSortMax(max);this.put("mSortMax", max);return this;};
	this.mSortIn=function(ids){
		if(this.proxy)return this.getProxy().mSortIn(ids);  this.put("mSortIn", ids);return this;
	};	
	
	/** 开启状态    1:关闭 2:开启     **/
	this.openState=function(openState){if(this.proxy)return this.getProxy().openState(openState);  this.put("openState", openState);return this;};
	/** and open_state is null */
	this.openStateNull=function(){if(this.proxy)return this.getProxy().openStateNull();if(this.get("openStateNot")==null)this.put("openStateNot", "");this.put("openState", null);return this;};
	/** not .... */
	this.openStateNot=function(){if(this.proxy)return this.getProxy().openStateNot();this.put("openStateNot", "not");return this;};
	this.openStateNotNull=function(){if(this.proxy)return this.getProxy().openStateNotNull();this.put("openStateNot", "not");this.put("openState", null);return this;};
	this.openStateNot=function(openState){if(this.proxy)return this.getProxy().openStateNot(openState);this.put("openStateNot", "not");this.put("openState", openState);return this;};
	this.openStateIn=function(ids){
		if(this.proxy)return this.getProxy().openStateIn(ids);  this.put("openStateIn", ids);return this;
	};	
	
	/** 修改时间 [非空]       **/
	this.updateTime=function(updateTime){if(this.proxy)return this.getProxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	/** and update_time is null */
	this.updateTimeNull=function(){if(this.proxy)return this.getProxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
	/** not .... */
	this.updateTimeNot=function(){if(this.proxy)return this.getProxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
	this.updateTimeNotNull=function(){if(this.proxy)return this.getProxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
	this.updateTimeNot=function(updateTime){if(this.proxy)return this.getProxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	/** and update_time >= ? */
	this.updateTimeStart=function(start){if(this.proxy)return this.getProxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
	/** and update_time <= ? */
	this.updateTimeEnd=function(end){if(this.proxy)return this.getProxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
	
	/** 添加时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.status=function(status){if(this.proxy)return this.getProxy().status(status);  this.put("status", status);return this;};
	/** and status is null */
	this.statusNull=function(){if(this.proxy)return this.getProxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
	/** not .... */
	this.statusNot=function(){if(this.proxy)return this.getProxy().statusNot();this.put("statusNot", "not");return this;};
	this.statusNotNull=function(){if(this.proxy)return this.getProxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
	this.statusNot=function(status){if(this.proxy)return this.getProxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	this.statusIn=function(ids){
		if(this.proxy)return this.getProxy().statusIn(ids);  this.put("statusIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有品牌信息 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/business/merchant.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取品牌信息分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/business/merchant.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取品牌信息 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/business/merchant.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

Merchant.get = function(id){
	var protocol = ux.ajax("/admin/business/merchant.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.merchant;
	return null;
}

Merchant.where = new Merchant.Where(0,true);